package com.nineclock.system.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.system.SMSControllerApi;
import com.nineclock.system.service.SMSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/sms")
@RestController
public class SMSController implements SMSControllerApi {
    @Autowired
    SMSService smsService;

    //发送验证码
    @Override
    @GetMapping("/code")
    public Result sendCode(String mobile, String type) {
        smsService.sendCode(mobile, type);
        return Result.success();
    }
    //验证码校验
    @Override
    @GetMapping("/verify")
    public Result<Boolean> checkCode(String checkcode, String mobile, String type) {
        Boolean b=smsService.checkCode(checkcode, mobile, type);
        return Result.success(b);
    }
}
